package 左哥算法.碰撞检测算法.BVH树;

public class BoundingBox {
    public double xMin, xMax, yMin, yMax;

    public BoundingBox(double xMin, double xMax, double yMin, double yMax) {
        this.xMin = xMin;
        this.xMax = xMax;
        this.yMin = yMin;
        this.yMax = yMax;
    }

    public boolean intersects(BoundingBox other) {
        return (this.xMin <= other.xMax && this.xMax >= other.xMin) &&
               (this.yMin <= other.yMax && this.yMax >= other.yMin);
    }
}
